// app.js
App({
  globalData: {
    userInfo: null,
    collections: [{
      id: 2,
      title: "Redmi Note12 ",
      cover: "https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1666797624.80788381.png",
      price: 1199,
      intro: "三星 OLED 护眼屏｜骁龙 5G 芯｜5000mAh 电量",
      isSelect: false,
      count: {
        quantity: 2,
        min: 1,
        max: 20
      },
    }],
    cartList: [
      {
        id: 2,
        title: "Redmi Note12 ",
        cover: "https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1666797624.80788381.png",
        price: 1199,
        intro: "三星 OLED 护眼屏｜骁龙 5G 芯｜5000mAh 电量",
        isSelect: false,
        count: {
          quantity: 2,
          min: 1,
          max: 20
        },
      }
    ],
    orders: [
      {
        id: 2,
        title: "Redmi Note12 ",
        cover: "https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1666797624.80788381.png",
        price: 1199,
        intro: "三星 OLED 护眼屏｜骁龙 5G 芯｜5000mAh 电量",
        isSelect: false,
        status: 1,
        count: {
          quantity: 1,
          min: 1,
          max: 20
        },
      }
    ],
  },
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
})